home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 020a / dvpt20.zip / VOICEKIT.DOC < prev    next >
Text File  |  1991-12-31  |  37KB  |  676 lines

  1.                Digitized Voice Programmer's Toolkit for the PC
  2.                -----------------------------------------------
  3.  
  4.                                Version 2.0
  5.  
  6.              Copyright (c) 1988,1989,1990,1991 Farpoint Software
  7.  
  8.                            Toolkit Instructions
  9.  
  10. ------------------------------------------------------------------------------
  11.  
  12.   ***************************************************************************
  13.   *                                                                         *
  14.   *  As this documentation file is being written, it has been almost two    *
  15.   *  and a half years since Version 1 was released, and three and a half    *
  16.   *  years since DIGITS.ARC and HIDI.ARC.  I have listened to a fair        *
  17.   *  amount of user feedback by this time, and feel that I know a little    *
  18.   *  more about what people want in a product like this one.  This release  *
  19.   *  is an attempt to respond to this feedback.  Here are some improvements *
  20.   *  you will find from the last version:                                   *
  21.   *                                                                         *
  22.   *  (1) BETTER SOUND QUALITY.  Everyone wants better sound. No surprise    *
  23.   *      here. This toolkit provides a dramatic improvement in output       *
  24.   *      quality over version 1. This goal took priority over everything    *
  25.   *      else. If you have version 1, try an A/B comparison.                *
  26.   *                                                                         *
  27.   *  (2) DIGITIZER HARDWARE IS AVAILABLE.  Many users preferred not to      *
  28.   *      build the digitizer themselves; unfortunately, Farpoint Software   *
  29.   *      never manufactured digitizers for commercial sale, making do-it-   *
  30.   *      yourself the only option. I'm sure a number of potential users     *
  31.   *      were turned away by this. We have now fixed this problem, at a     *
  32.   *      significant financial risk. (So buy one!)                          *
  33.   *                                                                         *
  34.   *  (3) SIMPLER PROGRAMMING INTERFACE.  The complexity of using the core   *
  35.   *      assembly language routines in high-level programs has been         *
  36.   *      reduced as much as possible. We have also included a true device   *
  37.   *      driver which allows any program written in any language to output  *
  38.   *      voice in a manner identical to a simple file write operation.      *
  39.   *                                                                         *
  40.   *  And, for balance, here are the things that went away since version 1:  *
  41.   *                                                                         *
  42.   *  (1) Background operation and file read-on-the-fly.  This was           *
  43.   *      necessary in order to achieve the desired sound quality            *
  44.   *      improvement. You can't allow interrupts when sub-microsecond       *
  45.   *      timing is required.                                                *
  46.   *                                                                         *
  47.   *  (2) Small voice data files.  They got bigger. Eight times as big when  *
  48.   *      uncompressed, four times when using Mu-Law compression.            *
  49.   *                                                                         *
  50.   *                                                                         *
  51.   *  Many thanks to all the honest people who registered for version 1.     *
  52.   *  Everyone who registered for version 1 is now automatically registered  *
  53.   *  for version 2.                                                         *
  54.   *                                                                         *
  55.   *                                                  - Alan D. Jones        *
  56.   *                                                                         *
  57.   ***************************************************************************
  58.  
  59. Introduction
  60. ------------
  61.  
  62. This toolkit is a combination of software and hardware designed for the
  63. purpose of mechanizing and simplifying the process by which programmers may
  64. create digitized voice recordings, store them on disk, edit the voice data
  65. files, and incorporate digitized voice playback into their own high-level
  66. language programs.
  67.  
  68. The recording of digitized voice requires an external hardware device. This
  69. archive includes the schematic of the device in several files, each
  70. appropriate for one popular printer type. The device is also available
  71. directly from Farpoint Software. Note that it is not the same as the digitizer
  72. used with DVPT version 1. This new digitizer had to be a little more complex
  73. to accomplish its task.
  74.  
  75. Playback of the digitized voice, however, requires NO SPECIAL HARDWARE. The
  76. sound is produced with the built-in speaker provided in nearly all PC's and
  77. PC-compatible machines. This means that programs may be written for general
  78. distribution which will play voice messages on the user's machine as it
  79. exists.
  80.  
  81. Here is a list of the major features of the current software package:
  82.  
  83.   (1) Operates under the DOS environment.
  84.   (2) Provides a full set of voice record/playback control routines which
  85.       are directly callable from many high-level languages including C
  86.       and Pascal. They are also, of course, callable from assembly language.
  87.   (3) There are no length limitations on either the size of the memory
  88.       buffers or the size of the voice data files on disk other than the
  89.       physical limits of the machine itself. 64k is not a special number.
  90.   (4) A sophisticated voice data file editor is provided. It has moved away
  91.       somewhat from the "tape recorder" model, and now provides a file
  92.       indexing feature that can be used to directly create "sound dictionary"
  93.       files of a format that is relatively easy for the programmer to
  94.       manipulate.
  95.   (5) Several short example programs are included, written in C, which
  96.       demonstrate the use of the calls to the voice modules, both as linked
  97.       object modules as a device driver.
  98.  
  99.  
  100. Shareware Notice
  101. ----------------
  102.  
  103. The Digitized Voice Programmer's Toolkit is released as Shareware. This is
  104. copyrighted material; it is NOT "free software". You are permitted to
  105. experiment with this package long enough to determine if it suits your needs,
  106. but if you will be making use of the material in your own programs, then a
  107. license fee of $50 is required. NO PROGRAM WHICH MAKES USE OF THE MATERIALS
  108. IN THIS TOOLKIT MAY BE SOLD COMMERCIALLY, ON A CONTRACT BASIS, OR AS SHAREWARE
  109. UNLESS THE SELLER HAS PAID THE LICENSE FEE. Please make all checks and/or
  110. money orders payable to:
  111.  
  112.         Farpoint Software
  113.         2501 Afton Court
  114.         League City, Texas 77573-3438
  115.  
  116. If you live in a country other than the United States of America, it will be
  117. necessary for you to either (1) Use a check drawn on a U.S. bank specified
  118. in U.S. funds, or (2) Use an "International Money Order", available from most
  119. banks, once again specified in U.S. funds. When we receive a small check from
  120. a non-U.S. bank, both banks charge us a "currency conversion fee" that totals
  121. literally almost as much as the check itself.
  122.  
  123. For your convenience and our records, a registration/order form is included
  124. in the file ORDER.FRM.
  125.  
  126. As a registered user, you will automatically receive software updates as they
  127. become available. You will also receive the source code to the VDFE editor
  128. and several experimental voice signal processing and compression programs.
  129. Registered users, of course, are given priority if programming assistance or
  130. hardware construction assistance is requested.
  131.  
  132. You are granted permission to distribute copies of the Digitized Voice
  133. Programmer's Toolkit, provided that (1) no fee is charged for such copies,
  134. other that a nominal disk duplication fee, (2) these files are distributed
  135. in their original, unmodified form, and (3) ALL the files in the original
  136. archive are included with each copy. (See "List of Files" below.)
  137.  
  138. If you paid a "disk duplication fee" or other such fee to a distributor of
  139. public domain and shareware programs, be aware that the payment of this fee
  140. DOES NOT constitute registration of this Toolkit. Likewise, the payment of a
  141. fee to any Bulletin Board Service for the time required to download this
  142. Toolkit DOES NOT constitute registration. Registration occurs only through
  143. direct interaction with Farpoint Software.
  144.  
  145. If more information is needed, write or contact Alan D. Jones through
  146. Compuserve Information Service at user ID 74030,554.
  147.  
  148. To the people who disseminate and distribute shareware:  Do NOT strip out the
  149. schematic files and distribute this kit without them. This is exactly what
  150. happened with the last version, causing a lot of confusion and headaches for
  151. both myself and potential users. Do NOT split this archive into more than one
  152. file and distribute it in that way, making it almost inevitable that one of
  153. the files will get lost.
  154.  
  155.  
  156. List of Files
  157. -------------
  158.  
  159. The files included with the Digitized Voice Programmer's Toolkit are:
  160.  
  161.        READ.ME          --  introductory note
  162.        VOICEKIT.DOC     --  this file
  163.        BUILDIT.DOC      --  digitizer construction details and parts list
  164.        VRMOD.DOC        --  descriptions of procedure calls in VRMOD.ASM
  165.        VPMOD.DOC        --  descriptions of procedure calls in VPMOD.ASM
  166.        ORDER.FRM        --  a printable registration form and order form
  167.        PRINTALL.BAT     --  prints out all the above files
  168.        ADJUST.EXE       --  tool for adjusting and testing the digitizer
  169.        VDFE.EXE         --  voice data file editor
  170.        VDFE.HLP         --  help file for the voice data file editor
  171.        VRMOD.ASM        --  assembly routines providing recording capability
  172.        VRMOD.OBJ        --  assembled VRMOD.ASM
  173.        VPMOD.ASM        --  assembly routines providing playback capability
  174.        VPMOD.OBJ        --  assembled VPMOD.ASM
  175.        VRMOD.H          --  include file with C prototypes for VRMOD calls
  176.        VPMOD.H          --  include file with C prototypes for VPMOD calls
  177.        VRTEST.C         --  simple C program demonstrating how to record
  178.        VRTEST           --  make file for VRTEST.C
  179.        VRTEST.EXE       --  executable recording program
  180.        VPTEST.C         --  simple C program demonstrating playback
  181.        VPTEST           --  make file for VPTEST.C
  182.        VPTEST.EXE       --  executable playback program
  183.        EMBEDDED.C       --  simple C program demonstrating embedded voice
  184.        EMBEDDED         --  make file for EMBEDDED.C
  185.        EMB_VOI.VOI      --  voice data for EMBEDDED.C
  186.        EMB_VOI.PRE      --  prefix file used in assembly file creation
  187.        EMB_VOI.SUF      --  suffix file used in assembly file creation
  188.        EMBEDDED.EXE     --  executable with embedded voice data
  189.        BIN2ASM.EXE      --  binary to DB statement converter
  190.        ULAW.C           --  Mu-Law compressor/encoder
  191.        ULAW             --  make file for ULAW.C
  192.        ULAW.EXE         --  executable Mu-Law compressor/encoder
  193.        UNULAW.C         --  Mu-Law decoder
  194.        UNULAW           --  make file for UNULAW.C
  195.        UNULAW.EXE       --  executable Mu-Law decoder
  196.        FSVPDD.SYS       --  voice playback device driver
  197.        VPDDTEST.C       --  simple C program demonstrating use of FSVPDD.SYS
  198.        VPDDTEST         --  make file for VPDDTEST.C
  199.        VPDDTEST.EXE     --  executable using device driver
  200.        DEMO.VOI         --  just a sample of recorded voice
  201.        RUN_ME.BAT       --  plays the demo
  202.        POSTSCRP.SCH     --  schematic for Postscript printer
  203.        HPGL.SCH         --  schematic for HPGL plotter
  204.        EPSONFX.SCH      --  schematic for Epson FX series printer
  205.        HPLASER.SCH      --  schematic for Hewlett-Packard LaserJet printer
  206.        IBMPRO.SCH       --  schematic for IBM Proprinter
  207.  
  208. If you received the Toolkit with any of the above files missing, please
  209. notify Farpoint Software.
  210.  
  211.  
  212. Description of Voice Subroutine Modules
  213. ---------------------------------------
  214.  
  215. The key software elements in the kit are two assembly language programs,
  216. VRMOD.ASM and VPMOD.ASM, and their assembled OBJ files. These are not stand-
  217. alone programs. They are designed to be linked with other programs to provide
  218. the voice control routines. The calls associated with recording are in
  219. VRMOD, and the calls associated with playback are in VPMOD. Any given program
  220. may be linked with either or both of these modules. Typically, a program
  221. designed for general distribution would be linked only with VPMOD, since
  222. recording requires the hardware device.
  223.  
  224. The external hooks to the two modules consist of various "public" procedure
  225. names. All procedures use the Pascal calling convention, since most high-level
  226. language compilers can support this calling method. The Pascal calling
  227. convention has the following meaning:
  228.  
  229.   (1) Procedure names are all caps, and are not preceeded by an underscore.
  230.   (2) Procedures are called with "far" (intersegment) calls.
  231.   (3) Short return values appear in the AX register; long return values
  232.       appear in DX:AX.
  233.   (4) Parameters are pushed onto the stack in left-to-right order; i.e. the
  234.       first parameter in the list is pushed first. If the parameter is a
  235.       doubleword, then the high order word is pushed first.
  236.   (5) The called subroutine is responsible for clearing the parameters from
  237.       the stack upon return.
  238.  
  239. The above list will be of interest primarily to assembly language programmers.
  240. When working in a high-level language, it is necessary only to make sure that
  241. the compiler is using the proper calling method. For C programs, two header
  242. files have been included. They are VRMOD.H and VPMOD.H. At the beginning of
  243. any C program that uses the voice playback routines, insert the line:
  244.  
  245. #include "vpmod.h"
  246.  
  247. This file contains prototypes of all procedure calls in VPMOD.ASM, declared
  248. in a way that causes the compiler to generate correct calling code.
  249.  
  250. The details of how each individual procedure call operates will be found in
  251. the separate documents VRMOD.DOC and VPMOD.DOC. It is suggested that you
  252. print these files for use as reference material while writing programs.
  253.  
  254.  
  255. Example Programs
  256. ----------------
  257.  
  258. Note: "Make" files acceptable to Microsoft's NMAKE utility are included
  259.       for all the example programs. The compiler used was the Microsoft
  260.       C Compiler version 6.00A. The assembler was the Microsoft Macro
  261.       Assembler version 5.10. The make files are written to assume that
  262.       the compiler is installed to include the Large model library and
  263.       that the default operating system is "neither". If the compiler
  264.       defaults to DOS, then change the make files so that all occurrences
  265.       of "llibcer" become "llibce".
  266.  
  267. VRTEST.C (VRTEST.EXE):
  268.   [Related files: VRTEST, VRMOD.H, VRMOD.ASM]
  269.   This program is a simple recorder, written to demonstrate the use of
  270.   procedure calls into VRMOD. To execute the program, first attach the voice
  271.   digitizer to a COM port and turn the device on; then at the DOS prompt
  272.   type:
  273.         VRTEST <port #> <filename>
  274.   For example, to record from COM2 into file TESTFILE.VOI, type:
  275.         VRTEST 1 TESTFILE.VOI
  276.   Recording will begin at the beep. Before recording starts, the program will
  277.   display a message indicating the size in both bytes and seconds of the
  278.   available recording buffer. Recording will continue until either a key is
  279.   pressed or the buffer is full, at which time the buffer will be written to
  280.   disk.
  281.  
  282. VPTEST.C (VPTEST.EXE):
  283.   [Related files: VPTEST, VPMOD.H, VPMOD.ASM]
  284.   This is the counterpart to VRTEST. It demonstrates the use of procedure
  285.   calls into VPMOD. To execute it, type:
  286.         VPTEST <filename>
  287.   The specified file will be loaded into a memory buffer, then played through
  288.   the speaker. In both this example and VRTEST, messages will be displayed as
  289.   necessary to indicate the meaning of the value returned by the calibration
  290.   procedure.
  291.  
  292. FSVPDD.SYS:
  293.   This is a true DOS device driver which implements the voice playback
  294.   functions. It calibrates upon initial load, thus removing that
  295.   responsibility from the calling program. The driver occupies about 3.6k
  296.   of memory. To load it, place the following line into the CONFIG.SYS file
  297.   on the boot drive, assuming the driver to be in the VOICE subdirectory on
  298.   drive C:
  299.         DEVICE=C:\VOICE\FSVPDD.SYS
  300.   The driver can then be used by ANY DOS program written in ANY language in
  301.   which files can be opened, written to, and closed. A mechanism is even
  302.   provided for playing buffers larger than 64k in size. To use the driver,
  303.   your program should perform the following actions:
  304.      (1) Open the file FSVPDD$$ and obtain a file handle or number.
  305.      (2) Allocate a buffer large enough to hold the voice data plus 4 bytes.
  306.      (3) Create a 32-bit integer indicating the voice data length in bytes.
  307.      (4) Copy this integer into the first 4 bytes of the allocated buffer.
  308.      (5) Fill the remainder of the buffer with the voice data.
  309.      (6) Perform a FILE WRITE operation to the handle obtained in step 1,
  310.          giving, as the data source, a pointer to the first byte in the
  311.          buffer. IMPORTANT: Pass the value 1 as the number of bytes to be
  312.          written. The driver will take the actual number of bytes from the
  313.          first 4 bytes in the buffer.
  314.      (7) (Optional.) Perform a FILE READ operation, again specifying 1 byte,
  315.          and giving, as the destination, the address of a variable which can
  316.          hold a 32-bit integer. After the read, this integer will contain the
  317.          actual number of bytes played.
  318.      (8) Free the buffer allocated in step 2.
  319.      (9) Close the file handle.
  320.  
  321. VPDDTEST.C (VPDDTEST.EXE):
  322.   This is an example written in C which uses the device driver FSVPDD.SYS.
  323.   It is the smallest of all the example executables, since the device driver
  324.   handles calibration and playback. The assembly routines do not need to be
  325.   linked to a program which uses the device driver.
  326.  
  327. EMBEDDED.C (EMBEDDED.EXE):
  328.   [Related files: EMBEDDED, VPMOD.H, VPMOD.ASM, EMB_VOI.VOI,
  329.    EMB_VOI.PRE, EMB_VOI.SUF]
  330.   This is a simple example of the techniques used to embed voice data in an
  331.   executable program. Instead of reading a separate voice file, the voice
  332.   data is part of the EXE file. Note that the "make" file in this case is
  333.   as important to study as the C program. The trick here is to convert the
  334.   raw binary voice data file into an OBJ file that can be fed through the
  335.   linker. This is done in three stages: (1) The file-cruncher program BIN2ASM
  336.   is used to create a file containing only a long list of assembly language
  337.   DB statements equivalent to the binary data; (2) The prefix file EMB_VOI.PRE
  338.   and the suffix file EMB_VOI.SUF are combined with the DB statements to form
  339.   an assembly language module containing all necessary segment brackets and
  340.   public declarations; (3) This module is assembled and linked with the main
  341.   program. The contents of the prefix and suffix files depend on the specific
  342.   application; in this example we use only a single segment and a single
  343.   block of voice data. A more complex program may contain several modules of
  344.   this type or have an assortment of labels within a single module. Since the
  345.   assembler requires segments to be 64k or less, BIN2ASM places a marker
  346.   comment (a semicolon and a string of minus signs) at each 64k boundary in
  347.   its output file. If this happens, you must edit the file to end a segment
  348.   and begin a new one at each of these boundaries.
  349.  
  350.  
  351. Other Programs
  352. --------------
  353.  
  354. ADJUST.EXE:
  355.   The purpose of this program is to facilitate the adjustment and testing of
  356.   digitizer boards. It has no command line parameters; simply type ADJUST to
  357.   start the program. There are three items of interest on the display:
  358.     (1) The COM port to which the digitizer is presumably attached while this
  359.      program runs. Cycle through the ports numbers by pressing <F2> until the
  360.      correct number appears.
  361.     (2) A DC offset meter which indicates the value of the average reading
  362.      from thr A/D converter relative to the "ideal" center point of 80 hex.
  363.      This reading should be adjusted to zero using R24.
  364.     (3) A signal level meter. This shows the instantaneous peak-to-peak
  365.      level being received by the A/D converter. It should be as low as you
  366.      can get it (while not speaking, of course). A reading of 10 to 20 or
  367.      less is considered reasonable. If the reading is higher, then possible
  368.      trouble sources might be: (a) high levels of room background noise from
  369.      things such as fans and air conditioners, (b) powering the digitizer with
  370.      an electrically noisy power supply, (c) poor wiring practices on the
  371.      digitizer or missing bypass capacitors, (d) input gain control R8 set
  372.      too high, or (e) the digitizer may be sitting too near a source of
  373.      radiated electrical noise, such as a switching power supply.
  374.  
  375. ULAW.EXE:
  376.   This program reduces the size of a voice data file by a 2:1 ratio by
  377.   encoding each 8-bit sample as a 4-bit number such that the quantization
  378.   error is minimized near the equilibrium (silence) point (80 hex) and
  379.   increases with increasing excursion. This is a common practice in telephone
  380.   systems used to reduce data throughput requirements. It causes surprisingly
  381.   little degradation of the sound quality, although there is some. The effect
  382.   of quantizing with this program has been described as a slightly "gritty"
  383.   quality in the reproduced speech. To execute, type:
  384.         ULAW <source filename> <destination filename>
  385.  
  386. UNULAW.EXE:
  387.   This program is the matching decoder for ULAW described above. Voice data
  388.   files encoded with ULAW cannot be played directly; they must first be
  389.   expanded with UNULAW. The purpose of these two programs is primarily to
  390.   reduce the size of voice data files for modem transfers. To execute, type:
  391.         UNULAW <source filename> <destination filename>
  392.   Source code has been included for both ULAW and UNULAW.
  393.  
  394. BIN2ASM.EXE:
  395.   This is a program which converts any binary file into a series of DB
  396.   statements which can be inserted into an assembly language program and
  397.   thereby made into an object module. Intended to be used in creating programs
  398.   with internally embedded voice data, its use is demonstrated in EMBEDDED.C.
  399.  
  400.  
  401. The Voice Data File Editor (VDFE)
  402. ---------------------------------
  403.  
  404. This program provides a convenient environment for creating, editing, and
  405. generally patching together voice data files, and creating index files for
  406. them. VDFE requires no command line parameters. Upon execution, it displays
  407. its primary screen and waits for user input. This consists of an assortment
  408. of single keystroke commands, accessible directly or through a keyboard
  409. operated pulldown menu system. The editor and its operation are described
  410. in detail in the file VDFE.HLP; this file can be displayed by pressing the
  411. <F1> key while executing VDFE.
  412.  
  413.  
  414. Graphical Print Files
  415. ---------------------
  416.  
  417. These files all contain a copy of the schematic of the digitizer. Several
  418. popular printers are supported. The files are:
  419.  
  420.   Filename        Printer/Plotter
  421.   --------        ---------------
  422.   POSTSCRP.SCH    Postscript printer
  423.   HPGL.SCH        HPGL plotter
  424.   EPSONFX.SCH     Epson FX series printer
  425.   HPLASER.SCH     Hewlett-Packard LaserJet printer
  426.   IBMPRO.SCH      IBM Proprinter
  427.  
  428. There are some fairly small text strings in the schematic, so all printers
  429. are used at their highest resolution. To print or plot the schematic, use
  430. the DOS copy command:
  431.         COPY /B <filename> <output port>
  432. For example, to print to a LaserJet connected to LPT1:
  433.         COPY /B HPLASER.SCH LPT1
  434.  
  435.  
  436. General Digitizer Information
  437. -----------------------------
  438.  
  439. Every effort has been made to avoid the use of unusual or hard-to-get parts
  440. in the design of this digitizer. For those who prefer not to build the
  441. digitizer circuit themselves, it has been made available as a fully built and
  442. tested board. The "unpopulated" (etched and drilled but no parts) board is
  443. also available. See the price list near the end of this document for details.
  444.  
  445. Unlike the digitizer used in DVPT version 1, which digitized its input
  446. directly into the bitstream to be used during playback, this digitizer is
  447. a classic 8-bit successive approximation analog-to-digital converter,
  448. combined with a microphone amplifier, anti-aliasing filter, level indicators,
  449. sample-and-hold amplifier, and a slightly odd 4-bit wide parallel interface
  450. to the PC serial port. Other features include a circuit which produces a
  451. small degree of amplitude compression to improve perceived loudness, an
  452. input gain control with a 20 decibel range (100:1), a DC offset trim, and
  453. a remote "stop" switch. The data read from the digitizer is stored as a simple
  454. list of 8-bit numbers, each indicating the voltage at the time of the sample.
  455. This storage scheme is commonly called PCM or Pulse Code Modulation.
  456.  
  457. The interface to the digitizer depends entirely on direct I/O bit manipulation
  458. of the PC serial port, and does NOT use the receiver serial interrupt. It
  459. should therefore work equally well connected to any PC serial port, from
  460. COM1 through COM4. The interconnecting cable must at least connect pins
  461. 3, 4, 5, 6, 7, 8, 20, and 22. When in doubt, use a full 25-wire "straight
  462. through" cable; a 2-3-7 or "three-wire" cable will not work. Do not use a
  463. null modem cable.
  464.  
  465. The circuit is designed to use a "dynamic" or moving magnetic coil type of
  466. microphone. Ceramic or piezoelectric (crystal) microphones can also be made
  467. to work by reducing the setting of the input gain control, but these types
  468. are often inferior to dynamic microphones. Electret and capacitor microphones
  469. won't work unless they provide their owm DC biasing. The type of handheld
  470. microphone that often comes with cheap portable cassette tape recorders is a
  471. good bet.
  472.  
  473. The power supply must be a split supply; i.e. a positive voltage and a
  474. negative voltage (relative to ground) of equal magnitudes. The easiest way
  475. to accomplish this is to use two 9 volt batteries. The supply must be at
  476. least (+) and (-) 7.5 volts for the circuit to work. A (+) and (-) 12 volt
  477. supply can be used as well; however, DON'T use a (+) and (-) 15 volt supply
  478. or 15 volt batteries, since this is equal to the absolute maximum rating of
  479. the MC1488 line driver and can easily destroy it. Also, DON'T get the supply
  480. polarity backwards; if this happens, nearly every semiconductor device on
  481. the board will be destroyed.
  482.  
  483. The Signal Level Indicators on the Digitizer
  484. --------------------------------------------
  485.  
  486. The LED labelled D8 is the -6 decibel threshold indicator; it lights when the
  487. signal exceeds one half of the maximum range of the A/D converter. The LED
  488. labelled D7 is the clipping indicator; it lights when the signal level equals
  489. or exceeds the maximum range of the A/D converter. The lighting of the
  490. clipping indicator means that the peaks of the reproduced waveform will be
  491. clipped or "flat-topped". A small amount of clipping on speech waveforms
  492. generally does not degrade intelligibility, although it can be psychologically
  493. irritating if it occurs over a significant portion of the data.
  494.  
  495. The level indicators are designed to be used in the following way: When
  496. speaking into the microphone or making a recording from another source, the
  497. input level (gain) control should be adjusted so that the -6db indicator
  498. remains lit a large percentage of the time, whereas the clipping indicator
  499. only flickers on the loudest peaks of the sound. This is the optimum signal
  500. level. It makes the maximum possible use of the resolution of the A/D
  501. converter without introducing an undue amount of clipping distortion.
  502.  
  503.  
  504. Digitizer Schematic Specifics
  505. -----------------------------
  506.  
  507. This section describes the signal flow through the digitizer. It's probably
  508. a good idea to have a printout of the schematic on hand while reading it.
  509.  
  510. U1:A and U1:D together form a microphone amplifier which provides most of
  511. the gain of the circuit. Capacitors C3 and C4 give the amplifier a gradual
  512. low frequency roll-off, experimentally and subjectively determined to
  513. maximize the intelligibility of the final result. The first stage (U1:A)
  514. gain can be adjusted with trimpot R8 from a minimum of 1 to a maximum of
  515. 100 (actually 101, given that the resistors were that accurate). The second
  516. stage (U1:D) provides an additional fixed gain of 23, for a total maximum
  517. voltage gain of 2300 for both stages.
  518.  
  519. U1:C, U1:B, and their associated passive components form a fourth order
  520. lowpass filter whose cutoff frequency is approximately 7000 Hz. Since the
  521. software drives the circuit at a conversion (sampling) rate of about
  522. 16500 Hz, the Nyquist criterion requires that frequencies above half of this
  523. (8250 Hz) be absent from the analog signal, or aliasing will occur. The
  524. lowpass filter approaches this situation well enough to eliminate audible
  525. aliasing effects. A full discussion of aliasing would take quite a bit of
  526. space and will not be presented here; there are numerous textbooks that cover
  527. the subject.
  528.  
  529. R10, R15, D3, D4, D5, and D6 are a crude amplitude (volume) compression
  530. circuit. The net effect of the circuit is a mild odd-harmonic distortion
  531. of the waveform which we accept in order to improve its dynamic range. The
  532. circuit causes the peak-to-peak gain of high-level signals to be less than
  533. that of low-level signals. This allows us to operate at higher overall input
  534. levels before severe clipping occurs, causing somewhat improved resolution
  535. (reduced quantization error) in the lower-volume sounds that contribute so
  536. much to the perceived "clarity" of a reproduced speech signal. There is also
  537. an increase in the perceived overall volume at the output.
  538.  
  539. C5 is a DC blocking capacitor. The appropriate DC offset required by the
  540. analog-to-digital converter is supplied by R9 and R16 or trimpot R24. D1 and
  541. D2 protect the circuitry which follows from overvoltages. U5 is a sample-and-
  542. hold amplifier, whose purpose is to maintain the input signal to the converter
  543. at a steady voltage during the actual conversion. U6 is an 8-bit successive-
  544. approximation analog-to-digital (A/D) converter capable of performing one
  545. conversion every 40 microseconds. Its conversion rate limit is therefore
  546. 25 KHz, more than sufficient for this application. The 8-bit result is
  547. multiplexed onto 4 lines by either U4 or U7, and the logic levels are changed
  548. to RS-232 levels by U3. U8 is an RS-232 receiver used to drive the control
  549. inputs on U5, U6, U4, and U7.
  550.  
  551. Dual opamp U2 is used as a visual signal level indicator. The opamps are wired
  552. as comparators. When the excursion of the signal being fed to U5 goes below
  553. ground, U2:A triggers, lighting LED D7 to indicate clipping. Note that the
  554. input signal range of the A/D converter is set up to range from zero volts to
  555. about 4 volts. The input signal needs to be only at one-half of the clipping
  556. amplitude in order to trigger U2:B, thus lighting LED D8. One-half amplitude
  557. equals 6 decibels below clipping.
  558.  
  559. U9 is a three terminal linear 5 volt regulator. It provides power to the
  560. ICs which must operate from a regulated 5 volt logic supply (U6, U4, U7, U8).
  561.  
  562. All the capacitors shown in parallel groups in the lower left area of the
  563. schematic are power supply bypass capacitors. Their purpose is to provide
  564. each IC with isolation from the noise induced on the power supply rails by
  565. the other parts of the circuit. These capacitors should be distributed around
  566. the board so that each power supply pin of each IC is connected directly to
  567. a bypass capacitor or a pair of bypass capacitors whose other terminal is
  568. solidly connected to ground. Components U1, U2, and U5 should have two bypass
  569. capacitors per power supply pin: one 0.1 uF and one 22 uF tantalum.
  570.  
  571. There are two locations in the schematic where redundant components are
  572. shown in order to increase versatility or availability:
  573.     (1) Use EITHER R9 and R16 OR trimpot R24, but not both;
  574.          R24 is recommended.
  575.     (2) Use EITHER U4 OR U7, but not both; selection depends on availability.
  576.  
  577. See the file BUILDIT.DOC for more construction details and a parts list.
  578.  
  579.  
  580. Playing Back Through the PC Speaker
  581. -----------------------------------
  582.  
  583. The speaker on the PC and its associated driver circuitry is quite simple and
  584. crude, having been designed primarily for creating single square-wave tones
  585. of various audio frequencies. This speaker is typically driven by a pair of
  586. transistors used as a current amplifier which is in turn driven directly by
  587. the output of a TTL gate. This results in only two possibilities of voltage
  588. across the voice coil: 0 volts and 5 volts. Any sound to be reproduced by
  589. this system must be reduced to an approximation in the form of a stream of
  590. constant-amplitude rectangular pulses of varying duration and frequency.
  591.  
  592. The exact details of the playback mechanism used in this package is probably
  593. best studied by looking at the code in VPMOD.ASM. Suffice it to say here that
  594. instantaneous DC drive voltages to the speaker are simulated by providing an
  595. alternating series of high and low output pulses such that the ratio of high
  596. pulses to low pulses averages out to the desired voltage. The lowpass
  597. filtering required is provided by the human ear and the mechanical limits of
  598. the speaker. Because of the nature of the speaker drive, the transition
  599. timings are quantized into discrete equally-spaced time intervals. The
  600. software has been written to minimize this interval (one NOP instruction)
  601. and therefore maximize the apparent "DC" resolution. The return value from
  602. the PCALIBRATE routine contains a "delay counter" value. This value is equal
  603. to the number of discrete steps available; the faster the computer, the
  604. greater the number of steps. Any number greater than or equal to 256 produces
  605. optimum sound reproduction, since this is the resolution at which the sound
  606.  
  607. was originally recorded. As the number of discrete steps decreases below 256,
  608. the sound quality degrades steadily, becoming moderately bad at 64. It is at
  609. this point that the PCALIBRATE routine declares the computer to be too slow.
  610. This number is reached when the CPU becomes an 8 MHz 286, so your programs
  611. should be targeted at systems with at least this level of performance.
  612.  
  613. And yes, if you have already looked, there is indeed self-modifying code in
  614. VPMOD.ASM. Whatever it takes to get the resolution.
  615.  
  616.  
  617. Prices for Software and Hardware
  618. --------------------------------
  619.  
  620. Registration for Software   -------------   $50
  621.  
  622.     Becoming registered gives you a license to use portions of the code
  623.     included with this toolkit in your own programs. It does not grant a
  624.     license to sell any of the complete working programs in this toolkit
  625.     intact as part of another package, with the sole exception of the
  626.     device driver, FSVPDD.SYS. If sold intact as part of another package,
  627.     this device driver may NOT be altered in any way.
  628.  
  629. -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  630.  
  631. Digitizer:                               UNREGISTERED users   REGISTERED users
  632.                                          ------------------   ----------------
  633.  Fully complete and tested digitizer
  634.  board with 30 day warranty (does not
  635.  include enclosure, batteries, serial
  636.  cable, or microphone)  ----------------------   $79   -----------   $59
  637.  
  638.  Unpopulated digitizer printed circuit
  639.  board only, etched and silkscreened,
  640.  without parts   -----------------------------   $21   -----------   $17
  641.  
  642. Other items:
  643.  
  644.  Schematic paper print   ----------------------   $5   -----------  Free
  645.  
  646. -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  647.  
  648. Incidental hardware: Although we can supply the following items,
  649. we recommend that you obtain them through your local consumer
  650. electronics stores and computer stores.
  651.  
  652.  Microphone   ---------------------------   $19
  653.  
  654.  DB-25 cable   --------------------------   $20
  655.  
  656.  DB-9 to DB-25 adapter   ----------------   $10
  657.  
  658. -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  659.  
  660. NOTICE: Since our manufacturing costs may increase as parts costs increase
  661.         over time, the prices quoted for hardware items are valid only through
  662.         December 1992.
  663.  
  664. Please address all correspondence to:
  665.  
  666.         Farpoint Software
  667.         2501 Afton Court
  668.         League City, Texas 77573-3438
  669.  
  670.             FAX: (713) 332-4730        Compuserve ID: 74030,554
  671.  
  672. If at all possible, use the form created by printing the file ORDER.FRM.
  673. If you choose to write in the information by hand, please print clearly.
  674. We have received several registration forms for version 1 which were quite
  675. difficult to read.
  676.